import java.util.Arrays;
import java.util.StringTokenizer;


class P11479_39643 {

    public static void main(String[] args) {
       
        int cases = Integer.parseInt(readLn());
       
        for (int k = 0; k < cases; k++) {
            StringTokenizer st = new StringTokenizer(readLn());
           
            long a = Integer.parseInt(st.nextToken());
            long b = Integer.parseInt(st.nextToken());
            long c = Integer.parseInt(st.nextToken());
       
            long[] triangle = {a, b, c};
           
            Arrays.sort(triangle);
           
            if (isInvalid(triangle)) {
                System.out.println("Case " + (k + 1) + ": " + "Invalid");
            } else if (triangle[0] == triangle[2]) {
                System.out.println("Case " + (k + 1) + ": " + "Equilateral");
            } else if (isIsosceles(triangle)) {
                System.out.println("Case " + (k + 1) + ": " + "Isosceles");
            } else System.out.println("Case " + (k + 1) + ": " + "Scalene");
           
        }
       
    }
   
    private static boolean isIsosceles(long[] triangle) {
        if (triangle[0] == triangle[1] || triangle[1] == triangle[2]) return true;
       
        return false;
    }

    private static boolean isInvalid(long[] triangle) {
        if (triangle[0] <= 0) return true;
       
       
        if (triangle[2] >= triangle[0] + triangle[1]) return true;
       
        return false;
    }

    static String readLn() {
        String newLine = System.getProperty("line.separator");
        StringBuilder buffer = new StringBuilder();
        int car = -1;
        try {
            car = System.in.read();
            while ((car > 0) && (car != newLine.charAt(0))) {
                buffer.append((char) car);
                car = System.in.read();
            }
            if (car == newLine.charAt(0))
                System.in.skip(newLine.length() - 1);
        } catch (java.io.IOException e) {
            return (null);
        }
        if ((car < 0) && (buffer.length() == 0))
            return (null);
        return (buffer.toString()).trim();
    }
   
   
}